package com.baidu.user.service.impl;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baidu.user.dao.ItemMapper;
import com.baidu.user.entity.Item;
import com.baidu.user.service.ItemService;

@Service
public class ItemServiceImpl implements ItemService {
	
	@Autowired
	private ItemMapper itemMapper;

	public List<Item> getItems(BigDecimal bigDecimal) {
		// TODO Auto-generated method stub
		return itemMapper.getItems(bigDecimal);
	}

	public List<Item> getItemsPublic() {
		// TODO Auto-generated method stub
		return itemMapper.getItemsPublic();
	}

	public void updateItem(Item item) {
		// TODO Auto-generated method stub
		if(item!=null&&item.getId()!=null){
			itemMapper.update(item);
		}
	}

	public void saveItem(Item item) {
		// TODO Auto-generated method stub
		itemMapper.insert(item);
	}

	public List<Item> findPersonageItems(BigDecimal id) {
		// TODO Auto-generated method stub
		return itemMapper.findPersonageItems(id);
	}

}
